﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Dln.Common.Helper;
using Dln.Handler;
using Dln.Model;
using Dln.Common;
using System.Data;

public partial class SendMessage : System.Web.UI.Page
{
    public string sql = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        string key = "KDNYPYWUMXOW5fEUZ6yUQ1aJx2tgMj5+MgNsqfi6FCcHWsWEAcelgg==";
        if (!string.IsNullOrEmpty(key))
        {
            var url = CommonHelper.GetAppSettings("DlnService1");
            object[] args = new object[1];
            args[0] = (key);
            object result = WebServiceHelper.InvokeWebService(url, "GetCurrDayInHospNum_Item", args);
            if (result != null)
            {
                DataSet ds = (DataSet)result;

                var dc = ds.Tables[0];
                if (!dc.Columns.Contains("ResultDataSet"))
                {
                    sql = "0";
                    HttpContext.Current.Response.Write(SqlHelper.GetTablejson(dc));
                    HttpContext.Current.Response.End();
                }
                else
                {
                    sql = "1";
                }

            }
            else
            {
                sql = "2";
            }
        }
    }
}